<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
	<!--
		Proof of concept for Ajax technology.
		Should work in IW, Safari, Mozilla's and Opera 8+.
		$Id: ajax-2.html,v 1.2 2006/05/15 11:52:53 justb Exp $
	   -->
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<title>Ajax Demo</title>

	<link href="../../assets/style.css" rel="stylesheet">

	<script type="text/javascript" src="../../lib/ajax-pushlet-client.js"></script>

	<script type="text/javascript"><!--

	PL.setDebug(false);

	// Pushlet Event Callback from Server
	function onEvent(event) {
		pr(event.toString());
	}

	function joinListen() {
		pr('joinListen...');
		PL.joinListen('/pushlet/ping');
	}

	function leave() {
		pr('leaving...');
		PL.leave();
	}

	// Print util
	function pr(aString) {
		document.disp.event.value = aString;
	}

	//-->
	</script>

</head>

<body>
<h3>Pushlet Protocol using XMLHttpRequest</h3>

<p>
	This example exercises the possible use of
	<a href="http://www.xml.com/pub/a/2005/02/09/xml-http-request.html">XMLHttpRequest</a>.
	Press [start] to stream events. Below are the raw events coming from the server.
</p>

<p>
	<a href="#" onclick="joinListen();return false;">[Start]</a> -
	<a href="#" onclick="leave();return false;">[Stop]</a>
</p>

<form name="disp">
	<table border="2" bordercolor="white" cellpadding="4" cellspacing="0">
		<tr>
			<td>
				<textarea cols="60" rows="16" name="event">
					NO DATA (idle)
				</textarea>
			</td>
		</tr>
	</table>
</form>
</body>
</html>
